/**
 * Copyright (c) 2012, Camelot and/or its affiliates. All rights reserved.
 * Camelot PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.camelot.ccr.system.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.camelot.ccr.global.dao.genericimpl.GenericHibernateDaoImpl;
import com.camelot.ccr.system.dao.UserDao;
import com.camelot.ccr.system.persistence.User;

/**
 * <pre>
 * <请输入描述信息>
 * </pre>
 * @author Liu Jun
 * @version V0.1, 2014-5-20 下午10:30:05
 */
@Repository
public class UserDaoImpl extends GenericHibernateDaoImpl<User, Integer> implements UserDao {

	/* (non-Javadoc)
	 * @see com.camelot.ccr.system.dao.UserDao#validatorLogin(java.lang.String, java.lang.String)
	 */
	@Override
	public User validatorLogin(String userName, String pwd) {
		String hql = "from User u where u.userName = ? and u.userpwd = ? ";
		List<String> params = new ArrayList<String>(2);
		params.add(userName);
		params.add(pwd);
		List<User> list = (List<User>) findByHQL(hql, params);
		return list.size()==0?null:list.get(0);
	}
	

	
}
